package com.chaos.framework.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author Jacky
 * @date 2020/5/26 11:58
 */
@Data
@NoArgsConstructor
public class Model extends PlainModel {

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;
    @TableLogic(value = "0", delval = "1")
    @TableField(value = "is_delete", fill = FieldFill.INSERT, select = false)
    private Integer isDelete;
    @Version
    @TableField(value = "version", fill = FieldFill.INSERT_UPDATE, update = "%s+1")
    private Integer version;

    @ApiModelProperty(value = "用户创建人")
    @TableField("creator")
    private String creator;
    @ApiModelProperty(value = "最后一次更新人")
    @TableField("updater")
    private String updater;
    @ApiModelProperty(value = "租户id")
    @TableField("tenant_id")
    private Long tenantId;
}
